<?php


namespace app\shopConsole\service\freight;



use app\dao\shop\FreightDao;
use app\dao\shop\FreightSpecialDao;
use app\model\ShopFreight;
use app\model\ShopFreightSpecial;

class FreightSpecialService
{
    /**
     * @var ShopFreightSpecial
     */
    private ShopFreightSpecial $shopFreightSpecial;

    public function __construct(ShopFreightSpecial $shopFreightSpecial)
    {
        $this->shopFreightSpecial = $shopFreightSpecial ;
    }

    public function create($data)
    {
        $freightSpecialtDao = new FreightSpecialDao();
        return $freightSpecialtDao->create($data);
    }

    public function update($data)
    {
        $freightSpecialDao = new FreightSpecialDao();

        return $freightSpecialDao->updateById($data, $this->shopFreightSpecial->id);
    }

    public function delete()
    {
        $freightSpecialDao = new FreightSpecialDao();
        $freightSpecialDao->deleteByid($this->shopFreightSpecial->id);
    }
}